<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title id="app-name">Exhibitor</title>

		<link rel="stylesheet" type="text/css" href="css/jquery/jquery-ui.custom.css" />
        <link rel="stylesheet" type="text/css" href="dynatree/skin/ui.dynatree.css">
        <link rel="stylesheet" type="text/css" href="css/exhibitor.css">
        <link rel="stylesheet" type="text/css" href="colortip-1.0/colortip-1.0-jquery.css">
        <link rel="stylesheet" type="text/css" href="css/jquery.dataTables_themeroller.css">

		<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
		<script type="text/javascript" src="js/jquery.cookie.js"></script>
		<script type="text/javascript" src="js/jquery.keyfilter.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>
		<script type="text/javascript" src="js/jquery.tools.min.js"></script>
        <script type="text/javascript" src="dynatree/jquery.dynatree.min.js"></script>
        <script type="text/javascript" src="colortip-1.0/colortip-1.0-jquery.js"></script>
        <script type="text/javascript" src="js/jquery.appear-1.1.1.js"></script>
        <script type="text/javascript" src="js/exhibitor-index.js"></script>
        <script type="text/javascript" src="js/exhibitor-cluster.js"></script>
        <script type="text/javascript" src="js/exhibitor-explorer.js"></script>
        <script type="text/javascript" src="js/exhibitor-modify.js"></script>
        <script type="text/javascript" src="js/exhibitor.js"></script>
        <script type="text/javascript" src="js/jquery.dataTables.js"></script>
        <script type="text/javascript" src="js/Scroller.js"></script>
        <script type="text/javascript" src="js/jquery.blockUI.js"></script>
        <script type="text/javascript" src="js/jquery.on-off.js"></script>
    </head>

	<body>
        <div id="tabs" class="ui-tabs">
            <div id="title" class="ui-state-active">
                <div id="page-title-container">
                    <div id="page-title">Exhibitor for ZooKeeper</div>
                    <div id="page-title-extra"></div>
                </div>
                <div id="version"></div><br clear="all"/>
            </div>

            <div id="standalone-mode-message" class="ui-helper-hidden">
                Standalone Mode - Ensemble is Manually Managed
            </div>

            <div class="ui-widget ui-helper-hidden" id="not-connected-alert">
                <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
                    <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
                        <strong id="not-connected-message"></strong></p>
                </div>
            </div>

            <ul id="tabs-list">
                <li><a href="#tabs-main">Control Panel</a></li>
                <li><a href="#tabs-explorer">Explorer</a></li>
                <li><a href="#tabs-config">Config</a></li>
                <li><a href="#tabs-restore">Backup and Restore</a></li>
            </ul>

            <div id="tabs-main" class="ui-helper-hidden">
                <div id="base-server-item">
                </div>
            </div>
            <div id="base-server-item-base" class="ui-helper-hidden">
                <div class="ui-widget ui-corner-all cp-server-item ui-state-highlight">
                    <div class="cp-servers-heading ui-state-default">
                        <div id="$BASE_ID$-open-window" class="open-window ui-icon ui-icon-newwin" title="Open Exhibitor view for this instance"></div>
                        <div class="cp-status-container">
                            <div id="$BASE_ID$-status-indicator" class="cp-status"></div>
                        </div>
                        <div class="cp-status-message-container">
                            <div id="$BASE_ID$-hostname"></div>
                            <div id="$BASE_ID$-server-id"></div>
                            <div id="$BASE_ID$-status-message"></div>
                        </div>
                        <br clear="both"/>
                    </div>

                    <div class="cp-server-column-wrapper">
                        <div class="cp-server-column">
                            <div title="When on, ZooKeeper instance is automatically restarted when there is an error, config change, etc.">
                                <label for="$BASE_ID$-instance-restarts-enabled">Automatic Instance Restarts</label><input type="checkbox" id="$BASE_ID$-instance-restarts-enabled" name="$BASE_ID$-instance-restarts-enabled"/><br clear="all"/>
                            </div>
                            <div title="When on, the ZooKeeper log cleanup task is active">
                                <label for="$BASE_ID$-cleanup-enabled">Log Cleanup Task</label><input type="checkbox" id="$BASE_ID$-cleanup-enabled" name="$BASE_ID$-cleanup-enabled"/><br clear="all"/>
                            </div>
                            <div title="When on, the ZooKeeper log backup task is active" id="$BASE_ID$-backups-enabled-control" class="ui-helper-hidden">
                                <label for="$BASE_ID$-backups-enabled">Backup Logs Task</label><input type="checkbox" id="$BASE_ID$-backups-enabled" name="backups-enabled"/><br clear="all"/>
                            </div>
                        </div>

                        <div class="cp-server-column">
                            <button id="$BASE_ID$-power-button">Restart...</button>
                            <button id="$BASE_ID$-4ltr-button">4LTR...</button>
                            <button id="$BASE_ID$-log-button">Log...</button>
                        </div>
                    </div><br clear="all"/>
                </div>
            </div>

            <div id="tabs-explorer" class="ui-helper-hidden">
                <div id="tree"></div>

                <div class="info">
                    <table>
                        <tr valign="top">
                            <td nowrap><strong>Path</strong></td> <td><span id="path"></span></td>
                        </tr>
                        <tr valign="top">
                            <td nowrap><strong>Stat</strong></td> <td><span id="stat"></span></td>
                        </tr>
                        <tr valign="top">
                            <td nowrap><strong>Data Bytes</strong></td> <td><span id="data-bytes"></span></td>
                        </tr>
                        <tr valign="top">
                            <td nowrap><strong>Data as String</strong></td> <td><span id="data-str"></span></td>
                        </tr>
                    </table>
                </div>

                <div id="explorer-buttons" class="ui-helper-hidden">
                    <button id="explorer-button-modify">Modify...</button>
                    <button id="explorer-button-analyze">Analyze...</button>
                    <button id="explorer-button-usage-listing">Usage Listing...</button>
                </div>
            </div>

            <div id="tabs-config" class="ui-helper-hidden">
                <div id="rolling-config-floater" class="ui-helper-hidden">
                    <p>
                    <strong>A rolling configuration release is in progress.</strong><br/><br/>
                    Status: <span id="rolling-config-floater-status"></span>
                    </p>
                    <div id="rolling-config-progressbar"></div>

                    <p>
                    The release can be canceled and possibly rolled back by clicking the Cancel Release button.
                    </p>

                    <div id="rolling-config-floater-button-container">
                        <button id="rolling-config-floater-button">Cancel Release...</button>
                    </div>
                </div>

                <div id="tabs-config-controls">
                    <div>
                        <div>
                            <label id="config-editable-label" for="config-editable">Editing </label><input type="checkbox" id="config-editable" name="config-editable" value="yes">
                        </div>
                    </div>
                    <div>
                        <button id="config-button">Commit...</button>
                    </div>
                    <div>
                        <button id="calculator-button">Calculator...</button>
                    </div>
                </div>
                <div id="config-warning">
                    <li>Note: sections colored in <span class="caution-legend">bold red</span> can cause server restarts when changed.<br>
                    <li>Hover over text boxes for detailed information on each configuration<br>
                </div>
                <br clear="all"/>

                <div id="config-group">
                    <fieldset class="caution-fieldset">
                        <legend class="caution-legend">Paths</legend>
                        <label for="config-zookeeper-install-dir">ZooKeeper Install Dir</label><input type="text" id="config-zookeeper-install-dir" name="config-zookeeper-install-dir" size="60" title="The directory where the ZooKeeper server is installed">
                            <button id="config-zookeeper-install-dir-help-button">Read Me</button><br clear="all"/>
                        <label for="config-zookeeper-snapshot-dir">ZooKeeper Snapshot Dir</label><input type="text" id="config-zookeeper-snapshot-dir" name="snapshot-zookeeper-snapshot-dir" size="60" title="The directory where the ZooKeeper snapshot data is stored"><br clear="all"/>
                        <label for="config-zookeeper-log-dir">ZooKeeper Transaction Dir</label><input type="text" id="config-zookeeper-log-dir" name="config-zookeeper-log-dir" size="60" title="The directory where the ZooKeeper transaction log data is stored. Leave blank to use the ZooKeeper Snapshot Dir"><span class="optional">optional</span>

                        <div id="config-latent-message">
                            NOTE: Until this section is populated Exhibitor will stay in a "latent" state.
                        </div>

                        <br clear="all"/>
                    </fieldset>

                    <fieldset class="caution-fieldset">
                        <legend class="caution-legend">Ensemble</legend>
                        <label for="config-servers-spec">Servers</label><textarea id="config-servers-spec" name="config-servers-spec" title="List of all servers in the ensemble (including this one) in the form: type:id:host,type:id:host,... The type should be 'S' for a standard server and 'O' for an observer." cols="60" rows="4"></textarea><br clear="all"/>
                        <label for="config-custom">Additional Config</label><textarea id="config-custom" name="config-custom" title="Any additional config/properties to be added to the zoo.cfg file in the form: name=value - one per line." cols="60" rows="4"></textarea><br clear="all"/>
                        <label for="config-java-env">java.env script</label><textarea id="config-java-env" name="config-java-env" title="Script to write as the 'java.env' file which gets executed as part of the ZooKeeper start script. Optional - leave blank for no file." cols="60" rows="4"></textarea><br clear="all"/>
                        <label for="config-java-log4j">log4j.properties</label><textarea id="config-java-log4j" name="config-java-log4j" title="Contents of the log4j.properties file. Optional - leave blank for no file." cols="60" rows="4"></textarea><br clear="all"/>
                    </fieldset>

                    <fieldset class="caution-fieldset">
                        <legend class="caution-legend">Ports</legend>
                        <label for="config-client-port">Client Port</label><input type="text" id="config-client-port" class="mask-pint" name="config-client-port" size="8" title="The port that clients connect to ZooKeeper (usually 2181)"><br clear="all"/>
                        <label for="config-connect-port">Connect Port</label><input type="text" id="config-connect-port" class="mask-pint" name="config-connect-port" size="8" title="The port that other ZooKeeper instances connect to ZooKeeper (usually 2888)"><br clear="all"/>
                        <label for="config-election-port">Election Port</label><input type="text" id="config-election-port" class="mask-pint" name="config-election-port" size="8" title="The port that other ZooKeeper instances connect for election to ZooKeeper (usually 3888)"><br clear="all"/>
                    </fieldset>

                    <fieldset id="fieldset-automatic-instance-management">
                        <legend>Automatic Server List Add/Remove</legend>
                        <span id="cp-auto-init-instances-help"><input type="checkbox" id="cp-auto-init-instances"></span>
                            &nbsp;&nbsp;&nbsp;&nbsp;<button id="cp-auto-init-instances-help-button">Read Me</button><br clear="all"/>
                        <label for="config-fixed-ensemble-size">Fixed Ensemble Size</label><input type="text" id="config-fixed-ensemble-size" class="mask-pint" name="config-automatic-management-period-ms" size="3" title="If non-zero, automatic instance management will attempt to keep the ensemble at this fixed size."><br clear="all"/>
                        <label for="config-automatic-management-period-ms">Settling Period (ms)</label><input type="text" id="config-automatic-management-period-ms" class="mask-pint" name="config-automatic-management-period-ms" size="8" title="Automatic Server List management will wait this long until the ZooKeeper ensemble has settled - i.e. no changes in quorum, etc. - before adding/removing instances."><br clear="all"/>
                        <label for="config-observer-threshold">Observer Threshold</label><input type="text" id="config-observer-threshold" class="mask-pint" name="config-observer-threshold" size="3" title="If not 0, marks which instances are made Observers by automatic instance management. Instances below this number are normal instances. Instances from this number and up are Observers."><br clear="all"/>
                        <label for="config-apply-all-at-once">Apply All At Once</label><select id="config-apply-all-at-once" class="mask-pint" name="config-apply-all-at-once" size="1" title="If set to 'yes', automatic instance management will apply changes all at once instead of via rolling config change. Experience has shown that rolling config changes can lead to runtime problems with the ZooKeeper ensemble.">
                            <option value="0">No</option>
                            <option value="1">Yes</option>
                        </select><br clear="all"/>
                    </fieldset>

                    <fieldset>
                        <legend>Miscellaneous</legend>
                        <label for="config-log-index-dir">Log Index Dir</label><input type="text" id="config-log-index-dir" name="config-log-index-dir" size="60" title="The directory where indexed ZooKeeper logs should be kept."><br clear="all"/>
                        <label for="config-check-ms">Live Check (ms)</label><input type="text" id="config-check-ms" class="mask-pint" name="config-check-ms" size="8" title="The number of milliseconds between live-ness checks on the ZooKeeper server"><br clear="all"/>
                        <label for="config-cleanup-ms">Cleanup Period (ms)</label><input type="text" id="config-cleanup-ms" class="mask-pint" name="config-cleanup-ms" size="8" title="The number of milliseconds between ZooKeeper log file cleanups"><br clear="all"/>
                        <label for="config-cleanup-max-files">Cleanup: Max Log Files</label><input type="text" id="config-cleanup-max-files" class="mask-pint" name="config-cleanup-max-files" size="2" title="The max number of ZooKeeper log files to keep when cleaning up"><br clear="all"/>
                    </fieldset>

                    <fieldset id="config-backups-fieldset">
                        <legend>Backups</legend>
                        <label for="config-backup-ms">Backup Period (ms)</label><input type="text" id="config-backup-ms" class="mask-pint" name="config-backup-ms" size="8" title="The number of milliseconds between ZooKeeper log backups"><br clear="all"/>
                        <label for="config-backup-max-store-ms">Max Save (ms)</label><input type="text" id="config-backup-max-store-ms" class="mask-pint" name="config-backup-max-store-ms" size="8" title="The max time to save backups. i.e. backups older than this will be deleted."><br clear="all"/>
                        <div id="config-backups-extra"></div>
                    </fieldset>
                </div>
                <br/>
            </div>

            <div id="tabs-restore" class="ui-helper-hidden">
                <div><strong>Available Indexes:</strong></div>
                <div id="restore-items">
                    <table id="restore-items-table">
                        <thead>
                        <tr>
                            <th></th>
                            <th>Name</th>
                            <th>From</th>
                            <th>To</th>
                            <th>Count</th>
                        </tr>
                        </thead>
                        <tbody id="restore-items-table-body">
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        </tbody>
                    </table>
                </div><br/>

                <button id="restore-open-button">Open...</button>
                <button id="restore-delete-button">Delete...</button>
                <button id="restore-index-button">New Index...</button>
            </div>
        </div>

        <div id="message-dialog" class="ui-helper-hidden">
            <p>
            <span id="message-dialog-icon" class="ui-icon ui-icon-alert" style="float: left; margin:0 7px 60px 0;"></span>
            <span id="message-dialog-text"></span>
            </p>
        </div>

        <div id="index-query-dialog" class="ui-helper-hidden">
            <label for="index-query-path">Partial Path</label><input type="text" id="index-query-path" name="index-query-path" size="30"><br clear="all"/>
            <label for="index-query-from">Date Range</label><input type="text" id="index-query-from" name="index-query-from" size="10">-<input type="text" id="index-query-to" name="index-query-to" size="10"><br clear="all"/>
            <label for="index-query-type">Type</label><select id="index-query-type" name="index-query-type" size="1">
                <option value="-1">Any</option>
                <option value="0">Create-Persistent</option>
                <option value="1">Create-Ephemeral</option>
                <option value="2">Delete</option>
                <option value="3">Set Data</option>
            </select><br clear="all"/>
            <label for="index-query-max">Max Results</label><select id="index-query-max" name="index-query-max" size="1">
                <option value="100">100</option>
                <option value="500">500</option>
                <option value="1000">1000</option>
                <option value="5000">5000</option>
            </select><br clear="all"/>
        </div>

        <div id="index-query-results-dialog" class="ui-helper-hidden">
            <div id="index-query-results-dialog-content"></div>
        </div>

        <div id="word-4ltr-dialog" class="ui-helper-hidden">
            <label for="word-4ltr">4LTR </label><input type="text" id="word-4ltr" name="word-4ltr" size="6">
            <button id="word-4ltr-button">Submit</button><br clear="all"/>
            <div id="word-4ltr-text" class="text"></div>
        </div>

        <div id="log-dialog" class="ui-helper-hidden">
            <button id="log-refresh-button">Refresh</button><br clear="all"/>
            <div id="log-text" class="text"></div>
        </div>

        <div id="millisecond-calculator-dialog" class="ui-helper-hidden">
            <input type="text" id="lhs-millisecond-calculator-value" name="lhs-millisecond-calculator-value" class="mask-pint" size="10" value="1">
            <select id="lhs-millisecond-calculator-unit" size="1">
                <option value="1">Milliseconds</option>
                <option value="1000">Seconds</option>
                <option value="60000">Minutes</option>
                <option value="3600000">Hours</option>
                <option value="86400000">Days</option>
            </select><br clear="all"/>
            <strong>=</strong><br/>
            <input type="text" id="rhs-millisecond-calculator-value" name="rhs-millisecond-calculator-value" class="mask-pint" size="10" value="1">
            <select id="rhs-millisecond-calculator-unit" size="1">
                <option value="1">Milliseconds</option>
                <option value="1000">Seconds</option>
                <option value="60000">Minutes</option>
                <option value="3600000">Hours</option>
                <option value="86400000">Days</option>
            </select><br clear="all"/><br/>
        </div>

        <div id="config-commit-dialog" class="ui-helper-hidden">
            <div class="config-commit-dialog-icon ui-icon ui-icon-alert"></div>
            <div>
                <strong>Warning</strong><br/>
                The changes you've made require that ZooKeeper instances get reconfigured and restarted. You
                can do this all at once (which can cause the ensemble to appear to be down for several minutes)
                or you can do a rolling release of the config.
            </div>
        </div>

        <div id="standalone-config-commit-dialog" class="ui-helper-hidden">
            <div class="config-commit-dialog-icon ui-icon ui-icon-alert"></div>
            <div>
                <strong>Warning</strong><br/>
                The changes you've made require that ZooKeeper instances get reconfigured and restarted. This Exhibitor
                is running in standalone mode. You will need to manually make these changes to the other ZooKeeper instances.
            </div>
        </div>

        <div id="rolling-config-cancel-dialog" class="ui-helper-hidden">
            <div id="rolling-config-cancel-dialog-icon" class="ui-icon ui-icon-alert"></div>
            Are you sure you want to cancel the rolling configuration release? If so, choose to either
            rollback to the previous configuration or force commit to the updated configuration.
        </div>

        <div id="get-node-data-dialog" class="ui-helper-hidden">
            <div>
                <label for="node-action">Type </label><select name="node-action" id="node-action">
                <option value="update">Create/Update</option>
                <option value="delete">Delete</option>
            </select><br clear="all"/>
            </div>
            <div>
                <label for="node-name">Path </label><input type="text" id="node-name" name="node-name" size="40"><br clear="all"/>
            </div>
            <div id="node-data-container">
                <label for="node-data">Data </label><textarea id="node-data" name="node-data" cols="45" rows="3"></textarea><select name="node-data-type" id="node-data-type">
                <option value="string">String</option>
                <option value="binary">Binary</option>
            </select><br clear="all"/>
            </div>

            <fieldset>
                <legend>Tracking</legend>
                <label for="node-data-user">Username</label><input type="text" id="node-data-user" name="node-data-user" size="20" title="Your username"><br clear="all"/>
                <label for="node-data-ticket">Ticket/Code</label><input type="text" id="node-data-ticket" name="node-data-ticket" size="20" title="Ticket/tag number for this operation"><br clear="all"/>
                <label for="node-data-reason">Reason</label><input type="text" id="node-data-reason" name="node-data-reason" size="40" title="Reason for the change"><br clear="all"/>
            </fieldset>
        </div>

        <div id="analyze-dialog" class="ui-helper-hidden">
            <div id="analyze-paths-container">
                <fieldset id="analyze-paths-$INDEX$">
                    <legend>Path $NUMBER$</legend>
                    <label for="analyze-node-name-$INDEX$">Path</label><input type="text" id="analyze-node-name-$INDEX$" name="analyze-node-name-$INDEX$" size="40" title="Parent path of the lock or one of the lock ZNodes"><br clear="all"/>
                    <label for="analyze-max-$INDEX$">Max Locks </label><input type="text" id="analyze-max-$INDEX$" name="analyze-max-$INDEX$" size="5" value="1" class="mask-pint" title="Maximum locks for this path. i.e. a mutex has a max of 1, a semaphore has a max of 1 to n."><br clear="all"/>
                </fieldset>
            </div>
            <button id="analyze-plus">Add a new path entry</button>
            <button id="analyze-minus">Remove a path entry</button>

            <div id="analyze-help">
                Enter one or more paths that represent a lock recipe. For each path, enter the maximum number of entries that represent ownership of the lock. i.e. mutexes have a max
                of 1; semaphores have a max of 1 to n.
            </div>
        </div>

        <div id="validate-modify-node-dialog" class="ui-helper-hidden">
            <p>
                <span class="ui-icon ui-icon-alert" style="float: left; margin:0 7px 150px 0;"></span>
                <span>
                    Are you certain you want to make this modification? It cannot be undone and might
                    irreparably harm the ZooKeeper data.
                </span>
            </p>
            <div id="validate-modify-node-action"></div>
            <div id="validate-modify-node-description"></div>
        </div>

        <div id="get-usage-listing-dialog" class="ui-helper-hidden">
            <div>
                <label for="usage-listing-path">Starting Path </label><input type="text" id="usage-listing-path" name="usage-listing-path" size="40" title="The starting path for the listing"><br clear="all"/>
                <label for="usage-listing-max">Max Traversal </label><input type="text" id="usage-listing-max" name="usage-listing-max" size="10" value="1000" class="mask-pint" title="Paths with this many child or greater will not be traversed"><br clear="all"/>
            </div>

            <div id="usage-listing-help">
                Enter a starting path for the listing and the maximum size path for traversal (i.e. paths with Max Traversal children will not be recursively listed). A detailed listing
                will be generated showing all the paths, their creation time, their immediate children count and their deep children count.
            </div>
        </div>

        <div id="index-query-table-template" class="ui-helper-hidden">
            <table id="$FOO$index-query-results-table"></table><br clear="all"/>
            <div id="$FOO$index-query-results-selected">
                <span class="label">Path</span><span id="$FOO$index-query-results-selected-path" class="value"></span><br clear="all"/>
                <span class="label">Date</span><span id="$FOO$index-query-results-selected-date" class="value"></span><br clear="all"/>
                <span class="label">Data Bytes</span><span id="$FOO$index-query-results-selected-data-bytes" class="value"></span><br clear="all"/>
                <span class="label">Data as String</span><span id="$FOO$index-query-results-selected-data-string" class="value"></span><br clear="all"/>
            </div>
            <button id="$FOO$index-query-filter-button">Filter...</button>
            <button id="$FOO$index-query-clear-filter-button">Clear Filter</button>
            <button id="$FOO$index-query-clear-restore-button">Restore...</button>
        </div>

        <div id="updating-config-dialog" class="ui-helper-hidden">
            <div id="updating-config-progressbar" class="ui-progressbar-value"></div>
        </div>
    </body>
</html>
